%% PrintLabels.tex - Printing Labels chapter
%% Created by Robert Heller on Sat Mar 14 21:59:04 1992
%%
%% ------------------------------------------------------------------
%% Home Libarian by Deepwoods Software
%% ------------------------------------------------------------------
%% Modification History:
%% ------------------------------------------------------------------
%% Contents:
%% ------------------------------------------------------------------
%% 
%% 
%% Copyright (c) 1991,1992 by Robert heller (D/B/A Deepwoods Software)
%%        All Rights Reserved
%% 
%%
\chapter{Printing Labels.}
\index{card catalog db@{\bf card catalog db}!printing labels from}

\label{PrintLabels}

\newcommand{\PrintLabels}{{\tt PrintLabels}}

The \PrintLabels\ program is meant primarily to generate labels for items
in your library, but it can also be used to generate just about any
formated textual output.

\section{Invoking \PrintLabels.}

\PrintLabels\ is invoked from the command line like this:
\begin{verbatim}

PrintLabels -infile <filename> -template <tfile> <options>

\end{verbatim}
Where \verb+<filename>+ is the file to print labels
from, \verb+<tfile>+ is a template file  and \verb+<options>+
consist of zero or more of the options listed in
Table~\ref{tab:prlabopts}.

\begin{table}
\label{tab:prlabopts}
\caption{\PrintLabels\ options}

\begin{tabular}{|l|l|}
\hline
Syntax&Description \\
\hline
\verb+-by id|title|author|subject+&\vtop{\hsize=2in Selects the type
of label to generate: shelf list labels (\verb+id+), title labels
(\verb+title+), author labels (\verb+author+), or subject labels
(\verb+subject+).} \\
%
\verb+-only <expression>+&\vtop{\hsize=2in 
\savetolerance=\tolerance
\tolerance=4000
Used to select a subset of
labels to generate. \verb+<expression>+ is a relational expression
comparing fields to selected values.
\tolerance=\savetolerance
} \\
\hline
\end{tabular}

\end{table}
The expression can contain the operators listed in Table~\ref{tab:exprops}.
Each relational expression needs to specify a field name and a value. 
The value must be of the correct type as shown in
Table~\ref{tab:prfieldtypes}.

\section{The Template File.}\index{label-temp@{\bf Label Template File}|bold}

The template file is a text file that is copied to the standard output
stream for each card record processed.  The file is copied literally,
except when a \verb+%+ character is encounted.  This character
indicates a field replacement as shown in Table~\ref{tab:prlabtemp}.
\begin{table}
\label{tab:prlabtemp}
\caption{\PrintLabels\ Template File Field Replacement Formats.}

\index{label-temp@{\bf Label Template File}!field replacement in}
\begin{tabular}{|l|l|}
\hline
Field&Replaced by \\
\hline
\verb+%%+&\verb+%+ \\
\verb+%id+&The id string. \\
\verb+%type+&The type. \\
\verb+%author+&The author. \\
\verb+%title+&The title. \\
\verb+%publisher+&The publisher. \\
\verb+%city+&The city. \\
\verb+%volume+&The volume. \\
\verb+%year+&The year. \\
\verb+%description+&The description. \\
\hline
\end{tabular}

\end{table}

\section{\PrintLabels\ Output.}

The output of \PrintLabels\ is to the standard output stream.  This can
be redirected with the output redirection command line character
(\verb+>+) or piped with the pipe character (\verb+!+ under OSK or
\verb+|+ under MS-DOS).



